﻿USE [iKBSystem]
GO

--FileSystem-----------------
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FileSystem]'))
DROP TABLE [dbo].[FileSystem]
GO

CREATE TABLE [dbo].[FileSystem](
	[Key] [uniqueidentifier] NOT NULL DEFAULT NEWID(),
	[SourceUrl] [varchar](500) NOT NULL,
	[SourceName] [nvarchar](200) NOT NULL,
	[FileName] [nvarchar](200) NOT NULL,
	[FileExtension] [varchar](20) NOT NULL DEFAULT '',
	[FileSize] int NOT NULL,
	[MD5] [varchar](150) NOT NULL,	
	[Description] [nvarchar](MAX) NULL,
	[Tags] [nvarchar](MAX) NULL,
	[CreatedStamp] [datetime] NOT NULL,
 CONSTRAINT [PK_FileSystem] PRIMARY KEY CLUSTERED 
([Key] ASC)ON [PRIMARY])

GO

--ThirdPartyUrl-----------------
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ThirdPartyUrl]'))
DROP TABLE [dbo].[ThirdPartyUrl]
GO

CREATE TABLE [dbo].[ThirdPartyUrl](
	[Url] [varchar](100) NOT NULL,
	[ActualUrl] [varchar](500) NOT NULL,
	[Title] [nvarchar](200) NULL,
	[Description] [nvarchar](200) NULL,
	[CreatedStamp] [datetime] NOT NULL,
	[LastUpdatedStamp] [datetime] NOT NULL,
 CONSTRAINT [PK_ThirdPartyUrl] PRIMARY KEY CLUSTERED 
([Url] ASC)ON [PRIMARY])
GO
